home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / Apple 2400.CCL next >
Encoding:
Text File  |  1992-09-18  |  21.0 KB  |  654 lines  |  [TEXT/MPS ]

  1. !
  2. ! Apple Data Modem 2400 CCL script (Hardware MNP)
  3. !
  4. !    Change History-
  5. !        v1.0        09/21/90    gs:General Release Version
  6. !        v1.0.2        12/07/90    gs:Added bug fix for Printer Port ~MPRT selection
  7. !        v1.0.2        01/30/91    gs:Changed \N3 to \N2 reliable only connection
  8. !
  9. !    The following label ranges (0-255) are defined for all scripts:
  10. !
  11. !    Label        Function
  12. !    -----        --------
  13. !    0-19        Communications Setup
  14. !    20-39        Get a Modem (IBX switch thru)
  15. !    40-59        Modem Setup
  16. !    60-79        Dialing
  17. !    80-99        Physical Connection
  18. !    100-119        GEIS Logon
  19. !    120-139        CICS
  20. !    140-159        APPM
  21. !    160-179        Online
  22. !    180-199        Terminate Session
  23. !    200-209        Cancel
  24. !    210-219        Hangup
  25. !    230-239        <UNUSED>
  26. !    240-255        Disconnect
  27. !
  28. !    Note:        Label 210 is the modem hangup sequence
  29. !                Label 240 is reserved as the start of the disconnect sequence
  30. !
  31. !================================================================================
  32. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  33. !================================================================================
  34. !
  35. !    Set the Baud, Data, Stop, and Parity bits
  36. SerReset ~Baud ~Prty ~Xbts ~Sbts
  37. CTBParameter Port "~MPrt" 13
  38. !
  39. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  40. CTBOpen 14 15        ! Open the Communications session
  41. !
  42. !    Flush any data, Initialize script variables and define Cancel label
  43. Flush                ! clear input buffer and ring buffer
  44. CanBtn 200            ! If user cancels, take the error return
  45. !
  46. SetVar 1 0            ! #of consecutive no responses to hangup command
  47. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  48. SetVar 3 0            ! #of consecutive network contact failures.
  49. SetVar 4 0            ! #of logon validation failures
  50. SetVar 5 0            ! #of consecutive CICS90  failures
  51. SetVar 6 0            ! #of consecutive APPM failures
  52. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  53. SetVar 8 0            ! not used
  54. !
  55. Jump 20                ! Go to Modem Selection and Setup
  56. !
  57. !*********
  58. -LABEL 13    !---<CTBParameter Port failed>---
  59. !*********
  60. Alert -1 CTBParameter Port caused an error.
  61. Exit -1                ! exit the script with an error.
  62. !
  63. !*********
  64. -LABEL 14    !---<CTBOpen failed>---
  65. !*********
  66. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  67. Exit -1                ! exit the script with an error.
  68. !
  69. !**********
  70. -LABEL 15    !---<CTBOpen err>---
  71. !**********
  72. Alert -1 CTBOpen caused an Communications Toolbox error.
  73. Exit -1                ! exit the script with an error.
  74. !
  75. !================================================================================
  76. -LABEL 20    !***<Modem Selection>*** Select modem through IBX switch
  77. !================================================================================
  78. !
  79. !================================================================================
  80. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  81. !================================================================================
  82. DsplyPic 1
  83. DsplyMsg Making sure the Apple Data Modem 2400 is ready.
  84. Jsr 210                ! Hang up (just in case)
  85. SetVar 1 0            ! clear # hangup tries counter
  86. !
  87. !**********
  88. -LABEL 42    ! ---<Got modem attention>---
  89. !**********
  90. DsplyMsg Setting modem parameters.
  91. !    Clear all previous MatchStr's and setup the modem
  92. MatchStr 1 42 Dummy
  93. Wait 30                ! Give modem .5 second to get ready before sending the attention chars
  94. Xmit AT
  95. !    Send Apple Data Modem 2400 specific commands
  96. Wait 3                ! Pause before "verbal result messages" command
  97. Xmit V1\92V1
  98. Wait 3                ! Pause before "wait for dial tone and detect busy" command
  99. Xmit X4
  100. Wait 3                ! Pause before "CD on only if carrier detected & protocol established”
  101. Xmit &C1
  102. Wait 3                ! Pause before "switched line" command
  103. Xmit &L0
  104. Wait 3                ! Pause before "drops phone line if DTR drops" command
  105. Xmit &D2
  106. Wait 3                ! Pause before "XonXoff control ON and don't pass them along" command
  107. Xmit \92Q1\92X0
  108. Wait 3                ! Pause before inactive timer set to infinite
  109. Xmit \92T0
  110. Wait 3                ! Pause before MNP selection of reliable stream mode
  111. Xmit \92N2
  112. Wait 3                ! Pause before break options,
  113. Xmit \92K5
  114. Wait 3
  115. Flush                ! clear input buffer and send Carriage Return (CR)
  116. Xmit \13
  117. !
  118. !    Look for one of the following expected responses
  119. MatchStr 1 60 OK
  120. Wait 180               ! wait 3 secs
  121. IncVar 2            ! increment # modem setup tries
  122. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  123. DsplyMsg Modem does not respond to setup commands. Retrying ...
  124. Jump 42                ! else try modem setup again
  125. !
  126. !**********
  127. -LABEL 44    ! ---<Modem configuration err>---
  128. !**********
  129. Bell
  130. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  131. SetVar 2 0            ! clear # modem setup tries
  132. Jump 40                ! reset modem and try again
  133. !
  134. !================================================================================
  135. -LABEL 60    !***<Modem ready>*** Dial phone
  136. !================================================================================
  137. DsplyMsg Dialing ~Fone ...
  138. DsplyPic 2
  139. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  140. MatchStr 1 60 Dummy
  141. SetVar 2 0            ! clear #modem setup tries
  142. !    Turn off Xon/Xoff flow control
  143. CTBParameter Handshake XON/XOFF 78
  144. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  145. Xmit AT
  146. Wait 3                ! Pause before "tone dial" command
  147. Xmit D~Tone
  148. Wait 3                ! Pause before phone number
  149. Xmit ~Fone
  150. Wait 3
  151. Flush                ! clear input buffer and send CR
  152. Xmit \13
  153. !
  154. !    Look for one of the following expected responses
  155. MatchStr 1 80 REL\13
  156. MatchStr 2 66 CARRIER
  157. MatchStr 3 70 BUSY
  158. MatchStr 4 74 NO DIAL
  159. MatchStr 5 62 ERROR
  160. Wait 2100            ! wait 35 secs
  161. !
  162. !**********
  163. -LABEL 62    !---<No response or ERROR from modem>---
  164. !**********
  165. IncVar 3            ! Increment # dial attempts counter
  166. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  167. DsplyMsg Modem does not respond to Dial command. Retrying ...
  168. Jump 40                ! reset modem and try again
  169. !
  170. !**********
  171. -LABEL 64    !---<No dial response err>---
  172. !**********
  173. Bell
  174. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  175. SetVar 3 0            ! clear # dial attempts counter
  176. Jump 40                ! reset modem and try again
  177. !
  178. !**********
  179. -LABEL 66   !---<No Carrier>---
  180. !**********
  181. IncVar 3            ! Increment # dial attempts counter
  182. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  183. DsplyMsg No Carrier with phone number dialed. Retrying ...
  184. Jump 40                ! reset modem and try again
  185. !
  186. !**********
  187. -LABEL 68    !---<No carrier err>---
  188. !**********
  189. Bell
  190. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  191. SetVar 3 0            ! clear # dial attempts counter
  192. Jump 40                ! reset modem and try again
  193. !
  194. !**********
  195. -LABEL 70    !---<busy>---
  196. !**********
  197. IncVar 3            ! Increment # dial attempts counter
  198. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  199. DsplyMsg Phone number dialed is busy. Pause  before retrying.
  200. Wait 300            ! wait 5 secs
  201. DsplyMsg Phone number dialed is busy. Retrying ....
  202. Jump 40                ! reset modem and try again
  203. !
  204. !**********
  205. -LABEL 72    !---<Busy err>---
  206. !**********
  207. Bell
  208. Alert 200 All network access lines are in use.\13Try again later.
  209. SetVar 3 0            ! clear # dial attempts counter
  210. Jump 40                ! reset modem and try again
  211. !
  212. !**********
  213. -LABEL 74    !---<No Dialtone>---
  214. !**********
  215. IncVar 3            ! Increment # dial attempts counter
  216. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  217. DsplyMsg Modem reports no dial tone. Retrying ...
  218. Jump 40                ! reset modem and try again
  219. !
  220. !**********
  221. -LABEL 76   !---<No dialtone Error>---
  222. !**********
  223. Bell
  224. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  225. SetVar 3 0            ! clear # dial attempts counter
  226. Jump 40                ! reset modem and try again
  227. !
  228. !*********
  229. -LABEL 78    !---<CTBParameter XON/XOFF failed>---
  230. !*********
  231. Alert -1 CTBParameter XON/XOFF caused an error.
  232. Exit -1                ! exit the script with an error
  233. !
  234. !================================================================================
  235. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  236. !================================================================================
  237. DsplyMsg Requesting network attention
  238. !    Look for one of the following expected responses
  239. MatchStr 1 84 NO CARRIER
  240. MatchStr 2 100 U#
  241. Wait 12                ! Wait 0.2 sec before sending the first H
  242. Xmit H
  243. Wait 21                ! Wait another 0.35 sec before sending the second H
  244. Xmit H
  245. Wait 600            ! Allow 10 seconds for the U# to show up
  246. IncVar 3            ! No U#, increment # dial attempts counter
  247. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  248. DsplyMsg Unable to get network attention. Retrying ...
  249. Jump 40                ! reset modem and try again
  250. !
  251. !**********
  252. -LABEL 82    !---<No U#>---
  253. !**********
  254. Bell
  255. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  256. SetVar 3 0            ! clear # dial attempts counter
  257. Jump 40                ! reset modem and try again
  258. !
  259. !**********
  260. -LABEL 84    !---<Line dropped>---
  261. !**********
  262. IncVar 3            ! Increment # dial attempts counter
  263. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  264. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  265. Jump 40                ! reset modem and try again
  266. !
  267. !**********
  268. -LABEL 86   !---<Line dropped Err>---
  269. !**********
  270. Bell
  271. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  272. SetVar 3 0            ! clear # dial attempts counter
  273. Jump 40                ! reset modem and try again
  274. !
  275. !================================================================================
  276. -LABEL 100    !***<GEIS logon>***
  277. !================================================================================
  278. !
  279. DsplyMsg Physical Connection established. Logging on to network ...
  280. DsplyPic 3
  281. SetVar 3 0            ! clear # dial attempts counter
  282. Wait 6                ! wait 0.1 sec
  283. Flush                ! clear input buffer
  284. !    Note: leave 2 spaces between ~Dist and ~Numb
  285. Xmit ~User,~Dist  ~Numb,~Ridn\13
  286. !
  287. !    Look for one of the following expected responses
  288. MatchStr 1 104 NO CARRIER
  289. MatchStr 2 106 DISCONNECTED
  290. MatchStr 3 120 ===>
  291. MatchStr 6 108 N FAULT,
  292. MatchStr 7 108 T FORMAT,
  293. MatchStr 8 110 L DENIED
  294. MatchStr 9 112 BUSY
  295. MatchStr 10 112 DOWN
  296. Wait 4200            ! wait up to 70 seconds for a response
  297. IncVar 4            ! Increment # logon attempts counter
  298. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  299. DsplyMsg No logon response from network. Retrying ...
  300. Jump 40                ! reset modem and try again
  301. !
  302. !*********
  303. -LABEL 102    !---<No Logon response>---
  304. !*********
  305. Bell
  306. Alert 200 No logon response from network.\13Try again.
  307. SetVar 4 0            ! clear # logon attempts counter
  308. Jump 40                ! reset modem and try again
  309. !
  310. !*********
  311. -LABEL 104    !---<Carrier dropped>---
  312. !*********
  313. IncVar 4            ! Increment # login attempts counter
  314. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  315. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  316. Jump 40                ! reset modem and try again
  317. !
  318. !*********
  319. -LABEL 105    !---<Carrier dropped Err>---
  320. !*********
  321. Bell
  322. Alert 200 Carrier signal dropped during network logon.\13Try again.
  323. SetVar 4 0            ! clear # logon attempts counter
  324. Jump 40                ! reset modem and try again
  325. !
  326. !*********
  327. -LABEL 106    !---<Session disconnected>---
  328. !*********
  329. IncVar 4            ! Increment # logon attempts counter
  330. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  331. DsplyMsg Network connection dropped during network logon. Retrying ...
  332. Jump 40                ! reset modem and try again
  333. !
  334. !*********
  335. -LABEL 107    !---<Session disconnected Err>---
  336. !*********
  337. Bell
  338. Alert 200 Network connection dropped during network logon.\13Try again.
  339. SetVar 4 0            ! clear # logon attempts counter
  340. Jump 40                ! reset modem and try again
  341. !
  342. !*********
  343. -LABEL 108    !---<Validation fault>---
  344. !*********
  345. IncVar 4            ! Increment # logon attempts counter
  346. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  347. DsplyMsg Network rejected your identification. Retrying ...
  348. Wait 60                ! wait 1 sec
  349. Jump 100            ! retry GEIS login (only case where we don't reset)
  350. !
  351. !*********
  352. -LABEL 109    !---<validation fault err>---
  353. !*********
  354. Bell
  355. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  356. SetVar 4 0            ! clear # logon attempts counter
  357. Jump 40                ! reset modem and try again
  358. !
  359. !*********
  360. -LABEL 110    !---<Denied by host>---
  361. !*********
  362. IncVar 4            ! Increment # logon attempts counter
  363. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  364. DsplyMsg Network host equipment problem detected. Retrying ...
  365. Jump 40                ! reset modem and try again
  366. !
  367. !*********
  368. -LABEL 111    !---<Denied by host err>---
  369. !*********
  370. Bell
  371. Alert 200 Network host equipment problem detected.\13Try again.
  372. SetVar 4 0            ! clear # logon attempts counter
  373. Jump 40                ! reset modem and try again
  374. !
  375. !*********
  376. -LABEL 112    !---<MARK3K access busy/down>---
  377. !*********
  378. IncVar 4            ! Increment # logon attempts counter
  379. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  380. DsplyMsg Network equipment busy/down. Retrying ...
  381. Jump 40                ! reset modem and try again
  382. !
  383. !*********
  384. -LABEL 113    !---<MARK3K access busy/down err>---
  385. !*********
  386. Bell
  387. Alert 200 Network equipment busy or down.\13Try again.
  388. SetVar 4 0            ! clear # logon attempts counter
  389. Jump 40                ! reset modem and try again
  390. !
  391. !================================================================================
  392. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  393. !================================================================================
  394. !
  395. DsplyMsg Requesting access to network subsystem ...
  396. DsplyPic 4
  397. Wait 6                ! wait 0.1 secs
  398. Flush                ! clear input buffer
  399. !
  400. Xmit ~CICS\13
  401. !    Look for one of the following expected responses
  402. MatchStr 3 140 READY
  403. !    To overcome a network problem, the following label was changed from 124 to 126
  404. !    MatchStr 4 124 T BOUND
  405. MatchStr 4 126 T BOUND
  406. MatchStr 5 126 UNRECOGN
  407. MatchStr 6 126 ===>
  408. Wait 3600            ! Allow 60 secs for the expected responses to show up
  409. IncVar 5            ! Timeout, so increment # CICS tries counter
  410. IfVar 5 2 122        ! if 3 tries, display No Response alert
  411. DsplyMsg No response to network subsystem request. Retrying ...
  412. Jump 40                ! reset modem and try again
  413. !
  414. !*********
  415. -LABEL 122    !---<No CICS err>---
  416. !*********
  417. Bell
  418. Alert 200 No response to network subsystem request.\13Try again.
  419. SetVar 5 0            ! clear # CICS tries counter
  420. Jump 40                ! reset modem and try again
  421. !
  422. !*********
  423. -LABEL 124    !---<Session not bound err>---
  424. !*********
  425. Bell
  426. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  427. Jump 200            ! jump to cancel routine
  428. !
  429. !*********
  430. -LABEL 126    !---<Invalid application>---
  431. !*********
  432. IncVar 5            ! Increment # CICS tries counter
  433. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  434. DsplyMsg Network subsystem request has been rejected. Retrying ...
  435. Wait 60                ! wait 1 sec
  436. Flush
  437. Jump 120            ! try to access CICS again
  438. !
  439. !*********
  440. -LABEL 127    !---<Invalid application err>---
  441. !*********
  442. Bell
  443. Alert 200 The network subsystem request has been rejected.\13Try again.
  444. SetVar 5 0            ! clear # CICS tries counter
  445. Flush
  446. Jump 40                ! reset modem and try again
  447. !
  448. !================================================================================
  449. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  450. !================================================================================
  451. !
  452. DsplyMsg Requesting access to distribution center ~Dist ...
  453. DsplyPic 5            ! Highlight box 5 on screen
  454. SetVar 5 0            ! clear # CICS tries counter
  455. !                    ! Send what needs to be sent
  456. Xmit ~Epgm~Dist\13
  457. !    Look for one of the following expected responses
  458. Wait 12                ! wait 0.2 secs
  459. Flush                ! clear input buffer
  460. !    Look for one of the following expected responses
  461. MatchStr 3 160 C100
  462. MatchStr 4 144 INVALID
  463. Wait 3600            ! Allow 60 secs for the expected responses to show up
  464. !
  465. IncVar 6            ! Timeout, so Increment # APPM tries counter
  466. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  467. DsplyMsg No response to distribution center access request. Retrying ...
  468. Jump 40                ! reset modem and try again
  469. !
  470. !*********
  471. -LABEL 142    !---<No transaction response>---
  472. !*********
  473. Bell
  474. Alert 200 No response to distribution center access.\13Try again.
  475. SetVar 6 0            ! reset # APPM tries counter
  476. Jump 40                ! reset modem and try again
  477. !
  478. !*********
  479. -LABEL 144    !---<Invalid transaction>---
  480. !*********
  481. IncVar 6            ! Increment # APPM tries counter
  482. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  483. DsplyMsg Distribution center access request rejected. Retrying ...
  484. Jump 40                ! reset modem and try again
  485. !
  486. !*********
  487. -LABEL 145    !---<Invalid transaction err>---
  488. !*********
  489. Bell
  490. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  491. SetVar 6 0            ! reset # APPM tries counter
  492. Jump 40                ! reset modem and try again
  493. !
  494. !================================================================================
  495. -LABEL 160    !***<Online>***
  496. !================================================================================
  497. !
  498. Wait 60                ! wait 1 sec
  499. DsplyMsg Accessing the distribution center ~Dist ...
  500. DsplyPic 6            ! Highlight box 6 on screen
  501. !    C9 = pass msg thru GE, 899 = Echo cmd
  502. Xmit C9899Ole\13
  503. !    Look for one of the following expected responses
  504. MatchStr 2 162 C5
  505. MatchStr 3 170 Ole\13
  506. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  507. !
  508. !*********
  509. -LABEL 162    !---<no luck this time>--- 
  510. !*********
  511. DsplyMsg Distribution center is not available ...
  512. Jsr 180                ! terminate session
  513. Bell
  514. Alert -1 Distribution center is not available.\13Please try again later.
  515. Jump 200            ! exit to Cancel routine
  516. !
  517. !*********
  518. -LABEL 170    !---<Success, we’re in, so exit>--- 
  519. !*********
  520. Wait 30                ! wait 0.5 secs
  521. Flush                ! clear input buffer
  522. Exit 0                ! exit the script normally
  523. !
  524. !================================================================================
  525. -LABEL 180-199    !***<Terminate Session>***
  526. !================================================================================
  527. !
  528. !*********
  529. -LABEL 180    !---<Terminate session>--- 
  530. !*********
  531. !    send Abnormal disconnect command
  532. Xmit C3\13
  533. !    Look for one of the following expected responses
  534. MatchStr 1 182 U#
  535. Wait 300            ! wait 5 secs
  536. Return
  537. !
  538. !*********
  539. -LABEL 182    !---<Say bye>---
  540. !*********
  541. Wait 6                ! wait 0.1 sec and sign off the network
  542. Xmit BYE\13
  543. Return
  544. !
  545. !================================================================================
  546. -LABEL 200    !***<Cancel Routine>***
  547. !================================================================================
  548. DsplyMsg Canceling ...
  549. Flush
  550. Wait 30                ! wait 0.5 secs
  551. Exit -1                ! exit the script with an error
  552. !
  553. !================================================================================
  554. -LABEL 210    !***<Hang up phone Routine>***
  555. !================================================================================
  556. !
  557. !    Look for one of the following expected responses
  558. MatchStr 1 222 CARRIER
  559. SetVar 1 0            ! clear # hangup tries counter
  560. SetVar 2 0            ! clear # modem config tries counter and reuse for MNPStatus checks
  561. !
  562. !*********
  563. -LABEL 220    !---<Hang up the phone subroutine>---
  564. !*********
  565. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  566. Xmit +
  567. Xmit +
  568. Xmit +
  569. Wait 60                ! wait 1 more sec (end guard time)
  570. Flush                ! clear input buffer and tell modem to hang up verbosely
  571. Xmit ATV1H\13
  572. !    Look for one of the following expected responses
  573. MatchStr 2 222 OK
  574. MatchStr 3 224 ERROR
  575. Wait 120            ! wait 2 secs
  576. Jump 224            ! test for error or no response            
  577. !
  578. !*********
  579. -LABEL 222    !---<Reset the modem>---
  580. !*********
  581. !
  582. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  583. !                      This aids in script debugging so we dont reset modem 1st time.
  584. Flush                ! Flush the buffer and send Hayes Reset Modem command
  585. Xmit ATZ\13
  586. !    Look for one of the following expected responses
  587. MatchStr 2 229 OK
  588. MatchStr 3 224 ERROR
  589. Wait 180            ! wait 3 secs
  590. !
  591. !*********
  592. -LABEL 224    !---<Error or just no response>---
  593. !*********
  594. IncVar 1            ! Increment # hangup tries counter
  595. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  596. Jump 220            ! try to hangup again
  597. !
  598. !*********
  599. -LABEL 225    !---<Error>---
  600. !*********
  601. IfVar 7 1 229        ! If disconnecting, just return.
  602. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  603. SetVar 1 0            ! clear # hangup tries counter
  604. Jump 220            ! try to hangup again
  605. !
  606. !*********
  607. -LABEL 229    !---<Return from the Hangup sequence>---
  608. !*********
  609. Wait 60                ! wait 1 sec
  610. Flush                ! clear input buffer
  611. Return
  612. !
  613. !================================================================================
  614. -LABEL 230-239    !***<UNUSED>***
  615. !================================================================================
  616. !
  617. !================================================================================
  618. -LABEL 240    !***<Disconnection Sequence>***
  619. !================================================================================
  620. !
  621. !    If the connection is closed, we cant hangup, so just exit
  622. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  623. CTBIFCLOSED 246
  624. !
  625. SetVar 7 1            ! We're disconnecting, so set the flag
  626. !    Look for one of the following expected responses
  627. MatchStr 1 242 U#
  628. MatchStr 2 244 NO CARRIER
  629. Wait 60                ! wait 1 sec
  630. Jump 244            ! and hang up the phone
  631. !
  632. !*********
  633. -LABEL 242    !---<Sign off the network>---
  634. !*********
  635. Xmit BYE\13
  636. Wait 120            ! wait 2 secs
  637. !
  638. !*********
  639. -LABEL 244    !---<Hang up the phone>---
  640. !*********
  641. SetVar 1 0            ! clear the # hangup tries counter
  642. Jsr 210                ! Execute the Hang-up subroutine
  643. !    No CTBClose here because the connection is closed externally from the script
  644. !    in case we exited the script with an error before completion.
  645. Flush                ! clear input buffer
  646. Exit 0                ! exit the script normally
  647. !
  648. !*********
  649. -LABEL 246    !---<Connection Was Closed>---
  650. !*********
  651. Flush                ! clear input buffer
  652. Exit 0                ! exit the script normally
  653. ###
  654.